BIN=my111
CC=gcc
#SRC=my111.c
SRC1=$(shell ls *.c)
#OBJ=my111.o
OBJ1=$(SRC1:.c=.o)
LFLAGS=-o
FLAGS=-c
RM=rm -f

$(BIN):$(OBJ1)
	@$(CC) $(LFLAGS) $@ $^
	@echo "linking ... $^ to $@"

%.o:%.c
	@$(CC) $(FLAGS) $<
	@echo "compling ... $< to $@"

.PHONY:
clean:
	$(RM) $(BIN) $(OBJ1)  

.PHONY:
test:
	@echo $(SRC1)
	@echo $(OBJ1)


#$(BIN):$(SRC)
#	@$(CC) $(FLAGS) $@ $^
#	@echo "linking ... $^ to $@"
#.PHONY:
#clean:
#	@$(RM) $(BIN)
#	@echo "remove ... $(BIN)"
